<?php
/**
 * Description
 * 
 * PHP version 7
 * 
 * @category Custom
 * @package  Custom
 * @author   ryu <mo5467@126.com>
 * @date     2020-04-23 00:01:36
 * @lastTime 2020-05-01 22:57:33
 * @license  https://opensource.org/licenses/MIT MIT License
 * @link     none
 */

namespace Test\Unit;

use Design\Creational\Builder\Director;
use Design\Creational\Builder\Parts\Car;
use Design\Creational\Builder\CarBuilder;
use Design\Creational\Builder\Parts\Truck;
use Design\Creational\Builder\TruckBuilder;

class BuilderTest extends \Test\BaseTest
{


    public function testCanBuildCar()
    {
        $carBuilder = new CarBuilder();
        $newVehicle = (new Director())->build($carBuilder);
        $this->assertInstanceOf(Car::class, $newVehicle);

    }//end testCanBuildCar()


    public function testCanBuildTruck()
    {
        $truckBuilder = new TruckBuilder();
        $newVehicle   = (new Director())->build($truckBuilder);
        $this->assertInstanceOf(Truck::class, $newVehicle);

    }//end testCanBuildTruck()


}//end class
